<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <link type="text/css" rel="stylesheet" href="../styles/add.css">
</head>
<body>

    <div style="position: absolute; width: 100%; height: 100%; background:#000; opacity:.7; filter:alpha(opacity=70); top: 0; right: 0;z-index: 1;"></div>

    <div class="add-outside">
        <div class="add-box">
            <div class="add-infor">
                <img src="../images/add.png" class="add-infor-img">
                <span class="add-infor-span">商品名称</span>
            </div>
            <div class="add-num">
                <span style="font-size: 14px;">请选择货品数量：</span>
                <div style="margin-top: 5px;padding-bottom:40px;border-bottom: lightgray solid 1px;">
                    <div class="add-gw_num">
                        <em class="add-minus">-</em>
                        <input type="text" value="5" class="number"/>
                        <em class="add-add">+</em>
                     </div>
                     <div style="display: inline-block;vertical-align: top;">
                        <span style="display: inline-block; font-size: 12px;">库存（5000）</span>
                     </div>
                </div>
                
            </div>
            <div class="add-confirm">
                <div id="add-yes">确定</div>
                <div id="add-no">取消</div>
            </div>
        </div>
    </div>
        
</body>
<script src="../scripts/jquery.js"></script>
<script>
    $(document).ready(function(){
     //加的效果
     $(".add-add").click(function(){
       var n=$(this).prev().val();
       var num=parseInt(n)+1;
       if(num==0){ return;}
          $(this).prev().val(num);
     });
     //减的效果
     $(".add-minus").click(function(){
       var n=$(this).next().val();
       var num=parseInt(n)-1;
       if(num==0){ return}
       $(this).next().val(num);});
    });
</script>

</html>